package com.hz.house.controller;

import com.hz.house.bean.entity.BuildingFocusReqBean;
import com.hz.house.bean.vo.WxMiniCheck;
import com.hz.house.common.ResultUtil;
import com.hz.house.service.CommonService;
import com.hz.house.service.home.BuildingSearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/ms/building")
@Api("公共接口")
public class MicroServiceController {

    @Autowired
    private CommonService commonService;

    @Autowired
    private BuildingSearchService buildingSearchService;

    /**
     * 服务内部调用检查是否内容安全接口
     */
    @PostMapping("/wxMiniCheck")
	@ApiOperation("小程序检测敏感内容")
    public Object checkContent(@RequestBody WxMiniCheck wxMiniCheck) {
        return ResultUtil.ok(this.commonService.wxMiniCheck(wxMiniCheck));
    }

    /**服务内部调用检查是否内容安全接口*/
    @PostMapping("/checkTextContent")
    public Object checkContent(@RequestBody String content) {
        return ResultUtil.ok(this.commonService.checkContent(content));
    }

    @GetMapping("/getXiaoChengxuTk")
    public Object getXiaoChengToken() {
        return this.commonService.getXiaoChengToken();
    }

    @GetMapping("/getMaiFGzhTk")
    public Object getMaiFGzhTk() {
        return this.commonService.getMaiFGzhTk();
    }

    /**
     * 查询用户关注的楼盘
     */
    @PostMapping("/getMyBuildingFocus")
    public Map<String, Object> getMyBuildingFocus(@RequestBody BuildingFocusReqBean bf) {
        return buildingSearchService.getMyBuildingFocus(bf);
    }

}
